public class MockFilterChain
extends java.lang.Object
javax.servlet.FilterConfig
interface.
Used for testing the web framework; also useful for testing
custom javax.servlet.Filter
implementations.
MockFilterConfig
,
PassThroughFilterChain
Modifier and Type | Field and Description |
---|---|
private ServletRequest |
request |
private ServletResponse |
response |
Constructor and Description |
---|
MockFilterChain() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(ServletRequest request,
ServletResponse response)
Records the request and response.
|
ServletRequest |
getRequest()
Return the request that
doFilter(ServletRequest, ServletResponse) has been called with. |
ServletResponse |
getResponse()
Return the response that
doFilter(ServletRequest, ServletResponse) has been called with. |
public void doFilter(ServletRequest request, ServletResponse response)
public ServletRequest getRequest()
doFilter(ServletRequest, ServletResponse)
has been called with.public ServletResponse getResponse()
doFilter(ServletRequest, ServletResponse)
has been called with.